package quiz9;

/**
 * Created by xujc on 7/14/15.
 */
public class Account {
    private String id;
    private double remain;

    public boolean withdrawMoney(double money){
        if (money<0){
            return false;
        }
        if (money>remain){
            return false;
        }
        remain-=money;
        return true;
    }

    public boolean depositMoney(double money){
        if (money<0){
            return false;
        }
        remain+=money;
        return true;
    }

    public double checkRemain(){
        return remain;
    }

    public Account(String id, double remain) {
        this.id = id;
        this.remain = remain;
    }
}
